﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Practice
{
    public partial class Homework02 : Form
    {
        public Homework02()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            cbx_city.Text = "北京";
        }

        //下拉框的值发生改变,触发下面的事件
        private void cbx_city_SelectedValueChanged(object sender, EventArgs e)
        {
            string Text = cbx_city.Text;
            if (Text == "上海")
            {
                lb_Num.Text = "上海1千万";
            }
            if (Text == "北京")
            {
                lb_Num.Text = "北京1千2百万";
            }
            if (Text == "南京")
            {
                lb_Num.Text = "南京5百万";
            }
            if (Text == "长沙")
            {
                lb_Num.Text = "长沙3百万";
            }
        }
    }
}
